﻿@{
    Layout = null;

}
@model Web.Areas.Admin.Models.LoginModel

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, AuthoringTagHelpers
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>登录</title>
    <link href="~/lib/Easyui/themes/icon.css" rel="stylesheet" />
    <link href="~/lib/Easyui/themes/bootstrap/easyui.css" rel="stylesheet" />

    <script src="~/lib/jquery-1.8.2.js"></script>
    <script src="~/lib/Easyui/jquery.easyui.min.js"></script>
    @*<script src="~/lib/jquery.validate.js"></script>
        <script src="~/lib/jquery.validate.unobtrusive.js"></script>*@
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.16.0/jquery.validate.min.js"></script>
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js"></script>
    
    <script src="~/lib/jquery.unobtrusive-ajax.min.js"></script>
    <script src="~/lib/MsgBox/jquery.msgbox.js"></script>

    <style type="text/css">
        #tbList {
            border: 0px #000 solid;
            width: 97%;
            margin: 5px auto;
            border-collapse: collapse;
        }

            #tbList td {
                border: 0px #000 solid;
                padding: 5px 10px;
            }

        .validation-summary-errors ul {
            list-style-type: none;
            padding: 0px;
            text-align: left;
            width: 200px;
            margin: 0px auto;
            color: red;
        }

            .validation-summary-errors ul li {
            }
    </style>

    <script type="text/javascript">
        $(function() {
            $("#loginWindow").window({
                iconCls: 'icon-tip',
                modal: true,
                closable: false,
                maximizable: false,
                minimizable: false,
                collapsible: false,
                draggable: false,
                resizable: false,
                width: 400,
                height: 250,
                title: '欢迎登录'
            });


        });

        //登录请求发送前执行
        function onBegin() {
            $.msgBoxObj.showWait("登录中，客官请稍后~~");
            $("#sumbit").attr({ "disabled": "disabled" });

        }
        //接收到响应报文后执行
        function onComplete(xhrObj) {
            $.msgBoxObj.hide();

            //  $.msgBoxObj.hide();
            //responseText  =   {"Status":1,"Msg":"登录成功了~","BackUrl":"/admin/manage/index","Data":null}
            $.msgProcess(xhrObj.responseText);
           
            $("#sumbit").removeAttr("disabled");
        }

        function onSuccess() {

        }

        function refresh() {
            var id = document.getElementById("nubImg");
            var str = "Login/Code?random=" + Math.random();
            id.setAttribute("src", str);
        }

    </script>


</head>
<body>
    <div id="loginWindow">






        <form asp-Controller="Login" asp-action="LoinCheck" data-ajax-begin="onBegin" data-ajax-complete="onComplete"
              data-ajax-failure="onFailed" data-ajax-success="onSuccess" data-ajax="true" data-ajax-method="POST" id="formId">

            <table id="tbList">
                <tr>
                    <td>@Html.DisplayNameFor(o => o.LoginName)</td>
                    <td colspan="2">
                        <input asp-for="LoginName" value="小白" class="validation-summary-valid" data-val="true" data-val-required="这是必填项"  />
                        <span data-valmsg-for="LoginName"  class="text-danger field-validation-valid"  data-valmsg-replace="true"></span>
                    </td>
                </tr>
                <tr>
                    <td>@Html.DisplayNameFor(o => o.PassWord)</td>
                    <td colspan="2">
                        <input asp-for="PassWord" data-val="true" class="validation-summary-valid"   data-val-required="请填写密码!"  />
                        <span data-valmsg-for="PassWord" class="text-danger field-validation-valid" data-valmsg-replace="true"></span>
                    </td>
                </tr>
                
                <tr><td>验证码</td>
                    <td colspan="2">
                        <input asp-for="Code" data-val="true" class="validation-summary-valid" data-val-required="请填写验证码!" />
                        <span data-valmsg-for="PassWord" class="text-danger field-validation-valid" data-valmsg-replace="true"></span>
                    </td>
                </tr>

                <tr>
                    
                    <td colspan="2">
                        <img id="nubImg" title="数字验证码" src="@Url.Content("Login/Code")"
                             alt="vcode" style="cursor:pointer;" />
                        <a id="kanbuq" href="javascript:void(0);" onclick="refresh()">看不清，换一张</a>
                    </td>
                   
                </tr>
                
                <tr>
                    <td colspan="3" style="text-align:center;">

                        <input type="submit" class="submit"  value="提交" />
                    </td>
                </tr>
                

            </table>
        </form>

        <div>

             

        </div>
    </div>



    
</body>
</html>
 